package com.xayy.mgt.controller;

import cn.kawins.base.result.ResultBody;
import cn.kawins.mybatis.base.BaseController;
import com.xayy.mgt.model.HealthDeep;
import com.xayy.mgt.model.vo.HealthDeepVo;
import com.xayy.mgt.service.HealthDeepService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/jkd1")
@Api(tags = "健康度")
public class HealthDeepController extends BaseController<HealthDeep> {

    @Resource
    private HealthDeepService healthDeepService;

    @PostMapping("/saveHealthDeep")
    @ApiOperation(value = "新增健康度")
    public ResultBody saveHealthDeep(@RequestBody HealthDeepVo healthDeepVo) {
        return healthDeepService.saveHealthDeep(healthDeepVo).body();
    }

    @PutMapping("/updateHealthDeep")
    @ApiOperation(value = "修改健康度")
    public ResultBody updateHealthDeep(@RequestBody HealthDeepVo healthDeepVo) {
        return healthDeepService.updateHealthDeep(healthDeepVo).body();
    }

    @GetMapping("/getHealthDeep/{nodeId}")
    @ApiOperation(value = "查看健康度详情")
    public ResultBody getHealthDeep(@PathVariable Long nodeId) {
        return healthDeepService.getHealthDeepVo(nodeId).body();
    }


}
